﻿using System;
using MessagePack.Internal;

namespace MessagePack.Decoders
{
	// Token: 0x020000DF RID: 223
	internal class FixExt4DateTime : IDateTimeDecoder
	{
		// Token: 0x0600033E RID: 830 RVA: 0x0000C3C3 File Offset: 0x0000A7C3
		private FixExt4DateTime()
		{
		}

		// Token: 0x0600033F RID: 831 RVA: 0x0000C3CC File Offset: 0x0000A7CC
		public DateTime Read(byte[] bytes, int offset, out int readSize)
		{
			sbyte b = (sbyte)bytes[offset + 1];
			if ((int)b != -1)
			{
				throw new InvalidOperationException(string.Format("typeCode is invalid. typeCode:{0}", b));
			}
			uint num = (uint)((int)bytes[offset + 2] << 24 | (int)bytes[offset + 3] << 16 | (int)bytes[offset + 4] << 8 | (int)bytes[offset + 5]);
			readSize = 6;
			return DateTimeConstants.UnixEpoch.AddSeconds(num);
		}

		// Token: 0x040000F9 RID: 249
		internal static readonly IDateTimeDecoder Instance = new FixExt4DateTime();
	}
}
